﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GenericLibrariesToolKit.Enumeration;

namespace GenericLibrariesToolKit
{
    /// <summary>
    /// where条件
    /// </summary>
    public class WhereCondition
    {
        /** where连接条件(and,or)，第一个条件此属性为空 **/
        public WhereJoinType WhereJoinType;
        /** 实体属性 **/
        public string EntityField {get;set;}
        /** 匹配类型 **/
        public MatchType FieldMatchType { get; set; }
        /** 匹配值 **/
        public object FieldMatchValue{ get; set; }

        /// <summary>
        /// 无参数构造函数
        /// </summary>
        public WhereCondition() { }

        /// <summary>
        /// 带四个参数的构造函数
        /// </summary>
        /// <param name="fieldJoinCondition">where连接条件</param>
        /// <param name="entityField">实体属性</param>
        /// <param name="fieldMatchType">实体匹配类型</param>
        /// <param name="fieldMatchValue">实体匹配值</param>
        public WhereCondition(WhereJoinType whereJoinType, string entityField, MatchType fieldMatchType, object fieldMatchValue)
        {
            this.WhereJoinType = whereJoinType;
            this.EntityField = entityField;
            this.FieldMatchType = fieldMatchType;
            this.FieldMatchValue = fieldMatchValue;
        }
    }
}
